import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[3*n];
        for (int i = 0; i < array.length; i++) {
            array[i] = sc.nextInt();
        }
        Arrays.sort(array);
        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += array[array.length - 2*(i+1)];
        }
        System.out.println(sum);
    }
}
